<?php

/* Don't remove these lines. */
add_filter('comment_text', 'popuplinks');

while ( have_posts() )
{
	the_post();

	echo "\n" . '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n";
	echo '<html xmlns="http://www.w3.org/1999/xhtml">' . "\n";
	echo '<head>' . "\n";
	echo '  <title>';
	printf(__('%1$s - Comments on %2$s', 'german_newspaper'), get_option('blogname'), the_title('','',false));
	echo '	</title>' . "\n\n";
	echo '	<meta http-equiv="Content-Type" content="' . get_bloginfo('html_type') . '; charset=' . get_option('blog_charset') . '" />' . "\n";
	echo '	<style type="text/css" media="screen">' . "\n";
	echo '		@import url( ' . get_bloginfo('stylesheet_url') . ' );' . "\n";
	echo '		body { margin: 3px; }' . "\n";
	echo '	</style>' . "\n";
	echo '</head>' . "\n\n";
	echo '<body id="commentspopup">' . "\n\n";
	echo '	<h1 id="header"><a href="" title="' . get_option('blogname') . '">' . get_option('blogname') . '</a></h1>' . "\n";
	echo '	<h2 id="comments">' . __('Comments', 'german_newspaper') . '</h2>' . "\n";
	echo '	<p><a href="' . get_post_comments_feed_link($post->ID) . '">' . __('<abbr title="Really Simple Syndication"><span class=\"rss_symbol\"></span>RSS</abbr> feed for comments on this post.', 'german_newspaper') . '</a></p>' . "\n";
	
 	if ( 'open' == $post->ping_status )
	{
	  echo '	<p>';
		printf(__('The <abbr title="Universal Resource Locator">URL</abbr> to TrackBack this entry is: <em>%s</em>', 'german_newspaper'), get_trackback_url());
		echo '	</p>' . "\n";
	}
	
	// this line is WordPress' motor, do not delete it.
	$commenter = wp_get_current_commenter();
	extract($commenter);
	$comments = get_approved_comments($id);
	$post = get_post($id);

	if ( !empty($post->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $post->post_password)
	{
		// and it doesn't match the cookie
		echo (get_the_password_form());
	}
	else
	{
  	if ( $comments )
		{
			echo '	<ol id="commentlist">' . "\n";

			foreach ( $comments as $comment )
			{
			  echo '		<li id="comment-' . get_comment_ID() . '">' . "\n";
			  comment_text();
			  echo '			<p><cite>';
				comment_type(__('Comment', 'german_newspaper'), __('Trackback', 'german_newspaper'), __('Pingback', 'german_newspaper'));
				echo ' ';
				printf(__('by %1$s &#8212; %2$s @ <a href="#comment-%3$s">%4$s</a>', 'german_newspaper'), get_comment_author_link(), get_comment_date(), get_comment_ID(), get_comment_time());
				echo '			</cite></p>' . "\n";
				echo '		</li>' . "\n";
				// end for each comment ?>
			}
			
			echo '	</ol>' . "\n";
		}
		else
		{
			// this is displayed if there are no comments so far
			echo '	<p>' . __('No comments yet.', 'german_newspaper') . '</p>' . "\n";
		}
		
		if ( 'open' == $post->comment_status )
		{
		  echo '	<h2>' . __('Leave a comment', 'german_newspaper') . '</h2>' . "\n";
		  echo '	<p>';
			printf(__('Line and paragraph breaks automatic, e-mail address never displayed, <acronym title="Hypertext Markup Language">HTML</acronym> allowed: <code>%s</code>', 'german_newspaper'), allowed_tags());
			echo '	</p>' . "\n";
			echo '  <form action="' . get_option('siteurl') . '/wp-comments-post.php" method="post" id="commentform">' . "\n";

			if ( $user_ID )
			{
				echo '		<p>';
				printf(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out &raquo;</a>', 'german_newspaper'), get_option('siteurl') . '/wp-admin/profile.php', $user_identity, get_option('siteurl') . '/wp-login.php?action=logout');
				echo '		</p>' . "\n";
			}
			else
			{
			  echo '		<p>' . "\n";
				echo '		<input type="text" name="author" id="author" class="textarea" value="' . $comment_author . '" size="28" tabindex="1" />' . "\n";
	   		echo '		<label for="author">' . __('Name', 'german_newspaper') . '</label>' . "\n";
	   		echo '		<input type="hidden" name="comment_post_ID" value="' . $id . '" />' . "\n";
	   		echo '		<input type="hidden" name="redirect_to" value="' . attribute_escape($_SERVER["REQUEST_URI"]) . '" />' . "\n";
	   		echo '		</p>' . "\n";
	   		echo '		<p>' . "\n";
	   		echo '	  <input type="text" name="email" id="email" value="' . $comment_author_email . '" size="28" tabindex="2" />' . "\n";
	   		echo '	  <label for="email">' . __('E-mail', 'german_newspaper') . '</label>' . "\n";
	   		echo '		</p>' . "\n";
	   		echo '		<p>' . "\n";
	   		echo '	  <input type="text" name="url" id="url" value="' . $comment_author_url . '" size="28" tabindex="3" />' . "\n";
	   		echo '	  <label for="url">' . __('<abbr title="Universal Resource Locator">URL</abbr>', 'german_newspaper') . '</label>' . "\n";
	   		echo '		</p>' . "\n";
			}

			echo '		<p>' . "\n";
			echo '	  <label for="comment">' . __('Your Comment', 'german_newspaper') . '</label>' . "\n";
			echo '		<br />' . "\n";
			echo '	  <textarea name="comment" id="comment" cols="70" rows="4" tabindex="4"></textarea>' . "\n";
			echo '		</p>' . "\n";
   		echo '		<p>' . "\n";
   		echo '	  <input name="submit" type="submit" tabindex="5" value="' . __('Say It!' , 'german_newspaper') . '" />' . "\n";
   		echo '		</p>' . "\n";
   		
   		do_action('comment_form', $post->ID);
   		
   		echo '	</form>' . "\n\n";
		}
		else
		{
			// comments are closed
			echo '	<p>' . _e('Sorry, the comment form is closed at this time.', 'german_newspaper') . '</p>' . "\n";
		}
	}
	// end password check

	echo '	<div><strong><a href="javascript:window.close()">' . __('Close this window.', 'german_newspaper') . '</a></strong></div>' . "\n";
}
// if you delete this the sky will fall on your head

//	<!-- // this is just the end of the motor - don't touch that line either :) -->

echo '<p class="credit">';
timer_stop(1);
echo '<cite>';
printf(__('Powered by <a href="%s" title="Powered by WordPress, state-of-the-art semantic personal publishing platform"><strong>WordPress</strong></a>', 'german_newspaper'), 'http://wordpress.org/');
echo '</cite></p>' . "\n";

// Seen at http://www.mijnkopthee.nl/log2/archive/2003/05/28/esc(18)

echo '<script type="text/javascript">
<!--
document.onkeypress = function esc(e) {
	if(typeof(e) == "undefined") { e=event; }
	if (e.keyCode == 27) { self.close(); }
}
// -->
</script>
</body>
</html>
';

?>